⚙️ Fix broken Docker build by removing non-existent AspireHost project reference #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The Docker build was failing with the following error:
The Dockerfile was trying to copy
samples/AspireHost/NLWebNet.AspireHost.csprojbut this file doesn't exist at that path. The actual file is located atsamples/AspireDemo/AspireHost/NLWebNet.AspireHost.csproj.Root Cause
The AspireHost project is part of a separate solution (
samples/AspireDemo/NLWebNet.AspireDemo.sln) and is not included in the main solution (NLWebNet.sln) that the Docker build targets. The Dockerfile is designed to build the Demo application, not the AspireHost project.Solution
Removed the incorrect project reference from the Dockerfile:
# Copy solution file and project files for dependency resolution COPY ["NLWebNet.sln", "./"] COPY ["src/NLWebNet/NLWebNet.csproj", "src/NLWebNet/"] COPY ["samples/Demo/NLWebNet.Demo.csproj", "samples/Demo/"] -COPY ["samples/AspireHost/NLWebNet.AspireHost.csproj", "samples/AspireHost/"] COPY ["tests/NLWebNet.Tests/NLWebNet.Tests.csproj", "tests/NLWebNet.Tests/"]Changes Made
deployment/docker/Dockerfile- Removed the line that copied the non-existent AspireHost project filetests/NLWebNet.Tests/Docker/DockerfileTests.cs- Regression tests to ensure:test-docker-fix.sh- Verification script for manual testingVerification
This is a minimal, surgical fix that removes only the problematic line without affecting the functionality of the Docker build for the Demo application.
Fixes #29.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.